import { login } from "@/api/index";
import { ReleaseOrderList, BatchGenList,edit, NewReleaseOrder, ReleaseDetail, takedowncheck,takedownconfirm} from "@/api/order";

import { resetRouter } from "@/router";
const getDefaultState = () => {
  return {

  };
};

const state = getDefaultState();

const mutations = {

};

const actions = {
  // user login
  ReleaseOrderList({ commit }, data) {
    return new Promise((resolve, reject) => {
      ReleaseOrderList(data)
        .then((res) => {
          resolve(res);
        }).catch((error) => {
       
          reject(error);
        });
    });
  },
  BatchGenList({ commit }, data) {

    return new Promise((resolve, reject) => {
      BatchGenList(data).then(res => {
        resolve(res)
      }).catch(error => {
     
        reject(error)
      })
    })
  },
  // /admin/release_order/v1/new
  NewReleaseOrder({ commit }, data) {
    return new Promise((resolve, reject) => {
      NewReleaseOrder(data).then(res => {
        resolve(res)
      }).catch(error => {
     
        reject(error)
      })
    })
  },
  ReleaseDetail({ commit }, data) {
    return new Promise((resolve, reject) => {
      ReleaseDetail(data).then(res => {
        resolve(res)
      }).catch(error => {
     
        reject(error)
      })
    })
  },
  takedowncheck({ commit }, data) {
    return new Promise((resolve, reject) => {
      takedowncheck(data).then(res => {
        resolve(res)
      }).catch(error => {
     
        reject(error)
      })
    })
  },
  takedownconfirm({ commit }, data) {
    return new Promise((resolve, reject) => {
      takedownconfirm(data).then(res => {
        resolve(res)
      }).catch(error => {
     
        reject(error)
      })
    })
  },
  edit({ commit }, data) { 
    return new Promise((resolve, reject) => {
      edit(data).then(res => {
        resolve(res)
      }).catch(error => {
     
        reject(error)
      })
    })
  }
};

export default {
  namespaced: true,
  state,
  mutations,
  actions,
};
